package com.tencent.wxcloudrun.controller.vo;

import com.tencent.wxcloudrun.model.Admin;
import lombok.Data;

@Data
public class AdminAuthInfoVo {

    private Long id;

    private String mobile; // 手机号（唯一）

    private String username;    // 用户名

    private String authToken;

    public static AdminAuthInfoVo buildByAdmin(Admin admin, String token) {
        AdminAuthInfoVo vo = new AdminAuthInfoVo();
        vo.id = admin.getId();
        vo.setUsername(admin.getUsername());
        vo.setMobile(admin.getUsername());
        vo.setAuthToken(token);
        return vo;
    }
}
